package org.ns.tomdog.server.support;

import org.ns.tomdog.server.Connector;
import org.ns.tomdog.server.Container;
import org.ns.tomdog.server.Server;

public class ServerStartup implements Server {
    private Connector connector;
    private Container container;

    public ServerStartup() {

    }

    public void setConnector(Connector connector) {
        this.connector = connector;
    }

    public void setContainer(Container container) {
        this.container = container;
    }

    @Override
    public void init() {
        // 容器初始化
        container.init();
        // 连接初始化
        connector.init();
    }

    @Override
    public void start() {
        // 容器启动
        container.start();
        // 连接启动
        connector.start();
    }

    @Override
    public Container getContainer() {
        return container;
    }

    @Override
    public Connector getConnector() {
        return connector;
    }
}
